package uc;

import co.chuangdian.oflauncher.R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.Gravity;
import android.widget.LinearLayout;
import cn.onekit.COLOR;
import cn.onekit.android.ACTIVITY;

public class TableRow extends LinearLayout {
	public TableRow(Context context) {
		super(context);
		init();
	}

	public TableRow(Context context, AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	void init() {
		this.setBackgroundResource(R.drawable.listviewrow);
		this.setGravity(Gravity.CENTER_VERTICAL);
		this.setPadding(ACTIVITY.dp2px(30.f), ACTIVITY.dp2px(10), ACTIVITY.dp2px(35), ACTIVITY.dp2px(10));
	}

	@SuppressLint("DrawAllocation")
	@Override
	protected void onDraw(Canvas canvas) {
		super.onDraw(canvas);
		Paint paint = new Paint();
		int width = this.getWidth();
		int height = this.getHeight();
		paint.setStrokeWidth(ACTIVITY.dp2px(0.5f));
		paint.setColor(COLOR.parse("#d8d8d8"));
		canvas.drawLine(0, height - ACTIVITY.dp2px(1), width, height - ACTIVITY.dp2px(1), paint);
	}
}
